
/**
  ******************************************************************************
  * Copyright 2021 The Microbee Authors. All Rights Reserved.
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  * 
  * http://www.apache.org/licenses/LICENSE-2.0
  * 
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  * 
  * @file       sensor_imu_bmi088.h
  * @author     baiyang
  * @date       2022-6-17
  ******************************************************************************
  */

#pragma once

#ifdef __cplusplus
extern "C"{
#endif

/*----------------------------------include-----------------------------------*/
#include "sensor_imu.h"
#include "sensor_imu_backend.h"

#include <common/time/gp_time.h>
#include <common/gp_rotations.h>
#include <device_manager/dev_mgr.h>
#include <common/gp_math/gp_mathlib.h>
/*-----------------------------------macro------------------------------------*/

/*----------------------------------typedef-----------------------------------*/
typedef struct sensor_imu_bmi088* sensor_imu_bmi088_t;

struct sensor_imu_bmi088 {
    sensor_imu_backend backend;

    gp_device_t dev_accel;
    gp_device_t dev_gyro;

    uint8_t accel_instance;
    uint8_t gyro_instance;
    enum RotationEnum rotation;
    uint8_t temperature_counter;
    enum ImuDevTypes _accel_devtype;
    float accel_range;

    bool done_accel_config;
    uint32_t accel_config_count;
};

/*----------------------------------variable----------------------------------*/

/*-------------------------------------os-------------------------------------*/

/*----------------------------------function----------------------------------*/
sensor_imu_backend * sensor_imu_bmi088_probe(gp_device_t dev_accel,
                                gp_device_t dev_gyro,
                                enum RotationEnum rotation);
/*------------------------------------test------------------------------------*/

#ifdef __cplusplus
}
#endif



